import myData from "../assets/vehicleInformation.js";

let disableData = [];

myData.filter((data) => {
  if (data.dispatchStatus == "支援") {
    disableData.push(data);
  }
});

export default function (router, DBserve) {
  // 添加调度数据
  DBserve({
    DBname: "vehicleDispatch",
    order: "count",
    option: {},
  }).then((data) => {
    // res.json(data);
    if (data.code == 200 && data.data == 0) {
      DBserve({
        DBname: "vehicleDispatch",
        order: "insert",
        option: disableData,
      }).then((data) => {
        if (data.code == 200) console.log("插入调度数据");
      });
    }
  });
}
